﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IRCServer.Utilities
{
    public enum ArgumentKey
    {
        NodeID,
        ConfigFilePath
    };

    public class ArgumentsParser
    {
        /// <summary>
        /// Gets the arguments passed to the router daemon in a dictionary.
        /// </summary>
        /// <param name="args">The args array passed to main().</param>
        /// <returns>Dictionary of the configuration key and value.</returns>
        public static Dictionary<ArgumentKey, object> GetArguments(string[] args)
        {
            if (args.Length != 2)
                throw new ArgumentOutOfRangeException();

            Dictionary<ArgumentKey, object> arguments = new Dictionary<ArgumentKey, object>();

            arguments.Add(ArgumentKey.NodeID, int.Parse(args[0]));
            arguments.Add(ArgumentKey.ConfigFilePath, args[1]);

            return arguments;
        }
    }
}
